#include "StdAfx.h"
#include "ExplodeAction.h"
#include "PhysicsEntity.h"


ExplodeAction::ExplodeAction(void)
{
}


ExplodeAction::~ExplodeAction(void)
{
}

bool ExplodeAction::FireTrigger(EntityControl *entity)
{
	//Ogre::Entity* originEntity = entity->getModelActor();
	//originEntity->setVisible(false);

	//// Make pieces
	//unsigned numSubEntities = originEntity->getNumSubEntities(); 
	//for (unsigned i = 0; i < numSubEntities; ++i)
	//{
	//	Ogre::Entity* newEntity =
	//		originEntity->clone(originEntity->getName() + "_cloned_" + Ogre::StringConverter::toString(i));
	//	for (unsigned j = 0;  j < numSubEntities; ++j)
	//	{
	//		newEntity->getSubEntity(j)->setVisible(i == j);
	//	}
	//	// attach the newEntity to the SceneNode that you need to control for exploding
	//	//originEntity->getParentSceneNode()->createChildSceneNode()->attachObject(newEntity);
	//}

	entity->getPhysicsActor()->getNxActor()->addForce(NxVec3(0.0, 10000000.0, 100000.0));

	return true;
}